package com.crazymaker.springcloud.demo.controller;

import com.crazymaker.springcloud.common.result.RestOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@Api("商品相关接口")
@Slf4j
@RequestMapping("/api/good")
public class GoodController {

    @RequestMapping(value = "/detail", method = RequestMethod.GET)
    @ApiOperation("商品详情接口")
    public RestOut<Object> goodsDetail(@RequestParam(value = "goodId", required = false) Long goodId) {
        Map<String, Object> map = new HashMap<>();
        map.put("12", "Spring源码解析");
        return RestOut.success(map);
    }
}
